package com.ruoyi.system.agriculture.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.agriculture.domain.po.AgInput;
import com.ruoyi.system.agriculture.mapper.AgInputMapper;
import com.ruoyi.system.agriculture.service.IAgInputService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 农业投入品Service业务层处理
 */
@Service
public class AgInputServiceImpl extends ServiceImpl<AgInputMapper, AgInput> implements IAgInputService {
    /**
     * 查询农业投入品列表
     * 
     * @param input 农业投入品信息
     * @return 农业投入品集合
     */
    @Override
    public List<AgInput> selectInputList(AgInput input) {
        LambdaQueryWrapper<AgInput> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(input.getInputName() != null, AgInput::getInputName, input.getInputName())
                .eq(input.getInputType() != null, AgInput::getInputType, input.getInputType())
                .like(input.getManufacturer() != null, AgInput::getManufacturer, input.getManufacturer())
                .like(input.getStorageLocation() != null, AgInput::getStorageLocation, input.getStorageLocation());
        return list(queryWrapper);
    }
} 